gdkwindow: Allow native subsurface for all parents
authorOlivier Fourdan <ofourdan@redhat.com>
Tue, 15 Nov 2016 13:49:03 +0000 (14:49 +0100)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 18 Nov 2016 18:25:36 +0000 (13:25 -0500)
Under Wayland, a subsurface can have another surface as parent, but
gdk would not allow native windows if the parent is not the root window.

Allow native subsurface for all parent under Wayland, not just for the
root window.

https://bugzilla.gnome.org/show_bug.cgi?id=774475

gdk/gdkwindow.c

index 3c3b0a071c52615da112f6c70b307e93e9e1f2b5..0fd20237915dd78792d7cfcbc6871db922c6f095 100644 (file)
@@ -1220,6 +1220,11 @@ gdk_window_new (GdkWindow     *parent,
   if (window->parent->window_type == GDK_WINDOW_ROOT)
     native = TRUE; /* Always use native windows for toplevels */
 
+#ifdef GDK_WINDOWING_WAYLAND
+  if (window->window_type == GDK_WINDOW_SUBSURFACE)
+    native = TRUE; /* Always use native windows for subsurfaces as well */
+#endif
+
   if (native)
     {
       event_mask = get_native_event_mask (window);